import requests
import execjs
import json

with open('1.js', 'r') as f:
    js = f.read()

ctx = execjs.compile(js)
headers = {
    'Connection': 'keep-alive',
    'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Mobile/15E148 Safari/604.1 wechatdevtools/1.06.2409140 MicroMessenger/8.0.5 Language/zh_CN webview/',
    'content-type': 'application/json',
    'Accept': '*/*',
    'Sec-Fetch-Site': 'cross-site',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Dest': 'empty',
    'Referer': 'https://servicewechat.com/wx7a4f0be35362b179/devtools/page-frame.html',
}
da = {
    "acc_id": 78,
    "page": 1,
    "class": "0",
    "sort": "4",
    "appid": "wx41cd4f32cf8164b3",
    "ver": "7.0.0",
    "min_push": 0,
    "scene": 1001
}
js_data = ctx.call('get_params', json.dumps(da))
params = {
    'requestData': js_data['request_data'],
    'iv': js_data['iv'],
}

response = requests.get('https://min-api.xliii.cn/miniapi/Product/pageIndex', params=params, headers=headers)

response_ = ctx.call('decrypt', response.json()['data']['data'], response.json()['data']['iv'])
for i in json.loads(response_)['data']['list']:
    print(i)
